<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="keyword" content="">

    <title>数据统计 - BIM管理</title>

    <!-- Bootstrap core CSS -->
    <link href="/Public/css/bootstrap.min.css" rel="stylesheet">
    <link href="/Public/css/bootstrap-reset.css" rel="stylesheet">
    <!--external css-->
    <link href="/Public/assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <!-- Custom styles for this template -->
    <link href="/Public/css/style.css" rel="stylesheet">
    <link href="/Public/css/style-responsive.css" rel="stylesheet" />
    <!-- new styles-->
      <link href="/Public/css/xxxstyle.css" rel="stylesheet" />
      <link href="/Public/echarts/css/font-awesome.min.css" rel="stylesheet">
      <link href="/Public/echarts/css/echartsHome.css" rel="stylesheet">
      <script src="/Public/echarts/esl/esl.js"></script>
    <!--gantt-->
      <link href="/Public/assets/jquery-gantt/gantt-style.css" rel="stylesheet" />

      <!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
    <!--[if lt IE 9]>
      <script src="/Public/js/html5shiv.js"></script>
      <script src="/Public/js/respond.min.js"></script>
    <![endif]-->
    <style>
		#mydiv1 {
			padding:0px;margin:0px;left:0px;top:0px;width:390px;height:390px;position:absolute;display:none;border:1px solid silver;background:rgba(255,255,255,0.8);z-index:20;
		}
	</style>
  </head>

  <body>

  <section id="container" class="">
      <!--main content start-->
      <section id="main-content">
          <section id="graphic" class="wrapper site-min-height">
              <!-- page start-->
              <div class="row">
                  <div class="col-lg-6 col-xs-12">
                      <section class="panel">
                          <header class="panel-heading">项目概述</header>
                          <div class="panel-body" style="height: 430px;">
                              <div class="dataStaBox" onMouseOver="javascript:show(this,'mydiv1')" onMouseOut="hide(this,'mydiv1')">
                               <?php if($image != ''): ?><img class="dataStaImg" src="<?php echo U('Index/himg',array('filename'=>$image));?>"/>
                                 <?php else: ?>
                                  <a href="<?php echo U("Bim/basics");?>" target='rightContent'><div class="dataStaImgNone"><i class="icon-gear"></i>点击前往形象进度照片页设置图片</div></a><?php endif; ?>
                              </div>
                              <div id="mydiv1">
	                              	<h5 style="color:green;">概况详情:</h5>
										&nbsp;&nbsp;&nbsp;&nbsp;<?php echo ($detail["profile"]); ?>
										 <br/>
									<h5 style="color:green;">阶段性详情:</h5>
									    &nbsp;&nbsp;&nbsp;&nbsp;<?php echo ($detail["stage"]); ?>
							  </div> 
                              <div class="dataStaBox">
                                  <div class="dataStaText"> 
                                   <?php if($project['speed'] != 2): ?><p>距<b class="ml10">成果交付</b></p>
	                                      <p><span><b><?php echo ($day["days"]); ?></b></span>天</p>
	                                   <?php if(is_array($milestone)): foreach($milestone as $k=>$v): if($v['status'] != 4): ?><p>距里程碑任务-<?php echo ($v["name"]); ?>结束还有<span style="color:red;font-size:20px;"><?php echo ($v["tian"]); ?></span>天</p>
	                                       <?php else: ?>
	                                       		 <p>里程碑任务-<?php echo ($v["name"]); ?><span style="color:green;font-size:20px;">已完成</span></p><?php endif; endforeach; endif; ?>
	                                      <p>总工期<span><?php echo ($day["day"]); ?></span>天</p>
	                                     <?php else: ?>
	                                      <p style="margin-top:100px;"><b class="ml10">项目已完成</b></p><?php endif; ?>
                                  </div>
                              </div>
                          </div>
                      </section>
                  </div>
                  <div class="col-lg-6 col-xs-12">
                      <section class="panel">
                          <header class="panel-heading tab-bg-dark-navy-blue">
                              <ul class="nav nav-tabs">
                                  <li class="active">
                                      <a href="#dataStaChart21" data-toggle="tab">BIM优化点</a>
                                  </li>
                                  <li>
                                      <a href="#dataStaChart22" data-toggle="tab">工期成本统计</a>
                                  </li>
                              </ul>
                          </header>
                          <div class="panel-body">
                              <div class="tab-content">
                                  <div class="tab-pane active" id="dataStaChart21">
                                      <div id="echartsOne" class="chartBox400"></div>
                                  </div>
                                  <div class="tab-pane" id="dataStaChart22">
                                    <?php if($gc != 1): ?><div id="echartsThree" class="chartBox400"></div>
                                      <div class="echartsOneAid">
                                          <p>+ 代表节约，- 代表增加</p>
                                      </div>
                                      <div class="echartsThreeAid">
                                          <p>总工期<span><?php echo ($num["time_limit"]); ?></span>总成本<span><?php echo ($num["cost"]); ?></span></p>
                                      </div>
                                    <?php else: ?>  
                                      <div class="GanttNone">
                                          <p><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</p>
                                      </div><?php endif; ?> 
                                  </div>
                              </div>
                          </div>
                      </section>
                  </div>
              </div>
              <div class="row">
                  <div class="col-lg-6 col-xs-12">
                      <section class="panel">
                          <header class="panel-heading">我的任务</header>
                          <div class="panel-body posRel">
                              <div id="echartsTwo" class="chartBox400"></div>
                              <div class="echartsTwoAid">
                                  <p>统计：</p>
                                  <p>已完成<span><?php echo ($hour["bai2"]); ?></span>工作    耗时<span><?php echo ($hour["hour2"]); ?></span>天</p>
                                  <p>进行中<span><?php echo ($hour["bai1"]); ?></span>工作    已用<span><?php echo ($hour["hour1"]); ?></span>天</p>
                                  <p>超时   <span>&nbsp;&nbsp;&nbsp;<?php echo ($hour["bai3"]); ?></span>工作   延误<span><?php echo ($hour["hour3"]); ?></span>天</p>
                              </div>
                          </div>
                      </section>
                  </div>
                  <div class="col-lg-6 col-xs-12">
                      <section class="panel">
                          <header class="panel-heading">任务进度</header>
                          <div class="panel-body">
                             <?php if($source != 1): ?><div id="GanttProjectProgress" class="chartBox400"></div>
                              <?php else: ?>
                              <div class="GanttNone">
                                  <p><i class="glyphicon glyphicon-exclamation-sign"></i>暂无数据</p>
                              </div><?php endif; ?>
                          </div>
                      </section>
                  </div>
              </div>
              <!-- page end-->
          </section>
      </section>
      <!--main content end-->
  </section>
    <!-- js placed at the end of the document so the pages load faster -->
    <script src="/Public/js/jquery.js"></script>
    <script src="/Public/js/jquery-1.8.3.min.js"></script>
    <script src="/Public/js/bootstrap.min.js"></script>
    <script class="include" type="text/javascript" src="/Public/js/jquery.dcjqaccordion.2.7.js"></script>
    <script src="/Public/js/jquery.scrollTo.min.js"></script>
    <script src="/Public/js/jquery.nicescroll.js" type="text/javascript"></script>
    <script src="/Public/js/jquery.customSelect.min.js" ></script>
    <!--common script for all pages-->
    <script src="/Public/js/common-scripts.js"></script>
    <!--new script for this page only-->
      <script type="text/javascript" src="/Public/echarts/js/echartsHome.js"></script>
      <script type="text/javascript">
          require.config({
              packages: [
                  {
                      name: 'echarts',
                      location: '../../../../Public/echarts/src',
                      main: 'echarts'
                  },
                  {
                      name: 'zrender',
                     // location: 'http://ecomfe.github.io/zrender/src',
                      location: '../../../../Public/echarts/zrender/src',
                      main: 'zrender'
                  }
              ]
          });
          
          var organs = <?php echo ($organs); ?>;
          var ordata = <?php echo ($ordata); ?>;
          var optionOne = {
              tooltip : {
                  trigger: 'axis'
              },
              legend: {
                  orient : 'vertical',
                  x : 'right',
                  y : 'bottom',
                  data:['BIM报告数量']
              },
              toolbox: {
                  show : true,
                  feature : {
                      saveAsImage : {
                          show: true,
                          name : 'BIM报告优化点分布图'
                      }
                  }
              },
              polar : [
                  {
                      indicator : [
                          { text: "设计( "+ ordata.design +"份 )"},
                          { text: "运维( "+ ordata.optimization +"份 )"},
                          { text: "验收( "+ ordata.check +"份 )"},
                          { text: "施工( "+ ordata.construction +"份 )"},
                          { text: "工期( "+ ordata.time +"份 )"},
                          { text: "成本( "+ ordata.cost +"份 )"}
                      ]
                  }
              ],
              calculable : false,
              series : [
                  {
                      type: 'radar',
                      data : [
                          {
                              value : organs,
                              name : 'BIM报告数量'
                          }
                      ]
                  }
              ]
          };
          
          var task = <?php echo ($task); ?>;
     
          var optionTwo = {
              tooltip : {
                  trigger: 'item',
                  formatter: "{a} <br/>{b} : {c} ({d}%)"
              },
              legend: {
                  orient : 'vertical',
                  x : 'left',
                  data:['已完成','进行中','延误']
              },
              toolbox: {
                  show : true,
                  feature : {
                      restore : {show: true},
                      saveAsImage : {
                          show: true,
                          name : '我的任务统计图'
                      }
                  }
              },
              calculable : true,
              color:[
                   '#337ab7', '#20A320', '#FFB577'
              ],
              series : [
                  {
                      name: '统计',
                      type:'pie',
                      radius : ['50%', '70%'],
                      itemStyle : {
                          normal : {
                              label : {
                                  show : true
                              },
                              labelLine : {
                                  show : true
                              }
                          },
                          emphasis : {
                              label : {
                                  show : true,
                                  position : 'center',
                                  textStyle : {
                                      fontSize : '30',
                                      fontWeight : 'bold'
                                  }
                              }
                          }
                      },
                    	data:task,
                  }   
              ]
          };
         
 var chart3colors = ['#5793f3', '#d14a61'];
var bid = <?php echo ($bid); ?>;
var cost = <?php echo ($cost); ?>;
var time_limit = <?php echo ($time_limit); ?>;
var optionThree = {
    color: chart3colors,

    tooltip: {
        trigger: 'axis',
        axisPointer: {type: 'cross'}
    },
    toolbox: {
        show : true,
        feature : {
            saveAsImage : {
                show: true,
                name : '工期成本统计图'
            }
        }
    },
    legend: {
        data:['工期','成本']
    },
    xAxis: [
        {
            type: 'category',
            axisTick: {
                alignWithLabel: true
            },
            data: /* ['1月','2月'] */bid,
        }
    ],
    yAxis: [
        {
            type: 'value',
            name: '工期(天)',
            min: -50,
            max: 50,
            position: 'left',
            axisLine: {
                lineStyle: {
                    color: chart3colors[0]
                }
            },
            axisLabel: {
                formatter: '{value}'
            }
        },
        {
            type: 'value',
            name: '成本(万元)',
            min: -50,
            max: 50,
            position: 'right',
           
            axisLine: {
                lineStyle: {
                    color: chart3colors[1]
                }
            },
            axisLabel: {
                formatter: '{value}'
            }
        }
    ],
    series: [
        {
            name:'工期',
            type:'bar',
            data:time_limit,
        },
        {
            name:'成本',
            type:'bar',
            yAxisIndex: 1,
            data:cost,
        },
    ]
};
          require(
                  [
                      'echarts',
                      'echarts/chart/line',
                      'echarts/chart/bar',
                      'echarts/chart/radar',
                      'echarts/chart/pie',
                      'echarts/chart/funnel'
                  ],
                  function (ec) {
                      var myChartOne = ec.init(document.getElementById('echartsOne'));
                      myChartOne.setOption(optionOne);
                      var myChartTwo = ec.init(document.getElementById('echartsTwo'));
                      myChartTwo.setOption(optionTwo);
                      var myChartThree = ec.init(document.getElementById('echartsThree'));
                      myChartThree.setOption(optionThree);
                  }
          )
      </script>
    <!--gantt-->
      <script src="/Public/assets/jquery-gantt/jquery.fn.gantt.js" charset="GB2312"></script>
      <script type="text/javascript">
          $(function() {
        	  var sour = <?php echo ($source); ?>;
              $("#GanttProjectProgress").gantt({
                 source: sour,
                /* [{
                     // name: "1",
                      desc: "1.1",
                      values: [{
                          from: "1490515200000",
                          to: "1492050229000",
                          desc: "详细描述",
                          label: "1号报告内审",
                          customClass: "ganttRed"
                      }]
                  },{
                     // name: "",
                      desc: "1.2",
                      values: [{
                          from: "/Date(1491123600000)/",
                          to: "/Date(1491377400000)/",
                          desc: "详细描述",
                          label: "1号报告设计院审批",
                          customClass: "ganttGreen"
                      }]
                  }],  */
                  months:["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
                  dow:["日", "一", "二", "三", "四", "五", "六"],
                  navigate: "scroll",
                  scale:"days",
                  minScale:"hours",
                  maxScale: "months",
                  itemsPerPage: 10,
                  waitText:"加载中,请稍等..."
              });
          });
          
          function show(obj,id) {
        	  var objDiv = $("#"+id+"");
        	  $(objDiv).css("display","block");
        	  $(objDiv).css("left", event.pageX + 10);
        	  $(objDiv).css("top", event.pageY + 10);
        	  }
       	  function hide(obj,id) {
	       	  var objDiv = $("#"+id+"");
	       	  $(objDiv).css("display", "none");
       	  } 
      </script>
  </body>
</html>